package com.shop.service.impl;

import com.github.pagehelper.PageInfo;
import com.shop.entity.seckillProducts;
import com.shop.mapper.seckillProductsMapper;
import com.shop.service.seckillProductsService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service("seckillProductsService")
@RequiredArgsConstructor
@Transactional(rollbackFor = RuntimeException.class,
        propagation = Propagation.REQUIRED)
public class seckillProductsServiceImpl implements seckillProductsService {

    private final seckillProductsMapper seckillProductsMapper;

    @Override
    public PageInfo<seckillProducts> listSeckillProducts() {
        return new PageInfo<>(seckillProductsMapper.listSeckillProducts());
    }

    @Override
    public void addSeckillProducts(seckillProducts seckillProducts) {
        seckillProductsMapper.addSeckillProducts(seckillProducts);
    }

    @Override
    public void updateSeckillProducts(seckillProducts seckillProducts) {
        seckillProductsMapper.updateSeckillProducts(seckillProducts);
    }
}
